package com.example.demo.dao;

import com.example.demo.model.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface StudentDao extends JpaRepository<Student,Long> {
    @Query(value = "select * from students where name=? or age=?",nativeQuery = true)
    List<Student> findByNameOrAge(String name,String age);
    List<Student> findByAge(Integer age);
}
